UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/FTIRQ95/WGHP3SR2QpDCc1WFycZdMN/2WrFP2PNVGk=' 
WHERE 
  key_id = 'c119d667cc1755c52b5b0de466fba29d40bf3e1099b16dc4c9cff515717219de' 
  AND (
    token = '/FTIRQ95/WGHP3SR2QpDCc1WFycZdMN/2WrFP2PNVGk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027