UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5b23c1WOkl/AKbgfNAAgyXeKo/ez29PcZg8+AeWWUXk=' 
WHERE 
  key_id = '162ef2f14b52d70deb90664da5eea437ca933619be66823fbc57da5221f33f90' 
  AND (
    token = '5b23c1WOkl/AKbgfNAAgyXeKo/ez29PcZg8+AeWWUXk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036