UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9jMTsrt6dcyYbDsUxtPDrXP0HAZ+PXRshomvEMjUR4k=' 
WHERE 
  key_id = '7b68f8b35ada92d12c532aef26449587604f99e47694d3c6266c61c9d9a21ab9' 
  AND (
    token = '9jMTsrt6dcyYbDsUxtPDrXP0HAZ+PXRshomvEMjUR4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025