UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jm/iGW1jZrSXi6ry3ERL5JlThZVM71vLywBcrcQT8nE=' 
WHERE 
  key_id = '33f37fa22c3c9a0cde5c997a7a470866f7e9aad77986302115d8fe711b8c401b' 
  AND (
    token = 'jm/iGW1jZrSXi6ry3ERL5JlThZVM71vLywBcrcQT8nE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028