UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fOUigMSgEBIZ+CbTijAQpbbKtqSG7bbdmjb0nukKLSE=' 
WHERE 
  key_id = 'bd5f1a1e0952b544edb4d3f5699bf75843004582bd5238d996906cb114cd8e85' 
  AND (
    token = 'fOUigMSgEBIZ+CbTijAQpbbKtqSG7bbdmjb0nukKLSE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024