UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3uqZaiTaGMt4wpvbyGN5PQVbh4pKPQInNEESRg7FuQY=' 
WHERE 
  key_id = '4510f612a9c8214d8f47773af7a0eb90d53419787075a36b486d3c7f20a73ca4' 
  AND (
    token = '3uqZaiTaGMt4wpvbyGN5PQVbh4pKPQInNEESRg7FuQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044