UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WJYzF0t0vGMLKr4NQipG7jVv/pz2YvBHz2tVExTe8nE=' 
WHERE 
  key_id = '8d2c18c9a5a6f506661018cd9d67057a34db61e31f8e3a97173e7e8c6e240185' 
  AND (
    token = 'WJYzF0t0vGMLKr4NQipG7jVv/pz2YvBHz2tVExTe8nE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017