UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qvJciM66MSNgEBbFd+CH63U865xKDqQGtZa51ocy7XI=' 
WHERE 
  key_id = 'b4cae0df0180b984d74d8498716026c97bb2b0c71ea37aa123c9068484ca1d3f' 
  AND (
    token = 'qvJciM66MSNgEBbFd+CH63U865xKDqQGtZa51ocy7XI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033