UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JQDd9eybo/+5BLZUoPYivhKyWDZh5CjQ6oF5G/51n5I=' 
WHERE 
  key_id = '0829d4b43c208da1f23ca6f721e990e547fa543d5dd46cd5f788f851713d671e' 
  AND (
    token = 'JQDd9eybo/+5BLZUoPYivhKyWDZh5CjQ6oF5G/51n5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021