UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k3Lz0aMOB6H03wLfZxrlUqbNhkzyUCvLBZe7XZXTwAE=' 
WHERE 
  key_id = 'a1ba8dcacbaa39ffb164cdd0a3691db48378ccfea0b3e8330f1701cf280d1ea3' 
  AND (
    token = 'k3Lz0aMOB6H03wLfZxrlUqbNhkzyUCvLBZe7XZXTwAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023