UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zIciu5AIgHVzoajoskA/GwXt0rONRxIKasoC6CEYE4U=' 
WHERE 
  key_id = '9ec14ab0cbdbecf391da0401de6d692092cfd9f87f5f4fa8b709ab73c7ceef74' 
  AND (
    token = 'zIciu5AIgHVzoajoskA/GwXt0rONRxIKasoC6CEYE4U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035