UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ERT9SbXVfDTyYcpzb432Hq6J8P9XziKfBm/w3syy76s=' 
WHERE 
  key_id = '8373f999d1cfe29f4f25790eaf6024a05e6ccfe2a5219d38f0a07e5519a23993' 
  AND (
    token = 'ERT9SbXVfDTyYcpzb432Hq6J8P9XziKfBm/w3syy76s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033