UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+dzQ0tdHYUuuwt9ZWK1OvSjXU6j2jptza5ZOEvxcpyo=' 
WHERE 
  key_id = '0e04b692f04a534ab29c3fa26f800f2ab263e538ad247d284837a0eabf754d98' 
  AND (
    token = '+dzQ0tdHYUuuwt9ZWK1OvSjXU6j2jptza5ZOEvxcpyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031