UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pm7zMDjiQ3ptJfSSCuwno+ATysfaPhJWdFazrUekbjg=' 
WHERE 
  key_id = 'eed67c5f89a3a5006e2db1d8d45144eaaf17e0dd9499413c42badcfa755ac5b9' 
  AND (
    token = 'Pm7zMDjiQ3ptJfSSCuwno+ATysfaPhJWdFazrUekbjg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060