UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lbrl7RlYdXxLPxydXyIIWM+SLjTr3etVYFyU8Ij1Ip0=' 
WHERE 
  key_id = '739ddb6ef70d603746e5923a914cdf637171f472bdd10229d6eb43653ffe88ca' 
  AND (
    token = 'lbrl7RlYdXxLPxydXyIIWM+SLjTr3etVYFyU8Ij1Ip0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031