UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QoeB/31YUl8PbV2rZG7F00N1/fMogCC8t5gNu02h9JY=' 
WHERE 
  key_id = '24eb517f97923e15815562992818fa0be1c4ca2b73bf98ddc206be6fcf07a01b' 
  AND (
    token = 'QoeB/31YUl8PbV2rZG7F00N1/fMogCC8t5gNu02h9JY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032