UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nR4ycxuOTcSJvJXUI4p7/fFzW9IknfDpHITxUPg4KZw=' 
WHERE 
  key_id = '60b67b25b851caef3e68f4861901ffde2c9f02f7f9a01784e44167ea0d662f57' 
  AND (
    token = 'nR4ycxuOTcSJvJXUI4p7/fFzW9IknfDpHITxUPg4KZw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050