UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '42NzrAbpwxfO/Ujg7jMMgH7tDFxGfxsU7d5cbSymYT8=' 
WHERE 
  key_id = '6de9fef4353b443e713a3262060962172940b431438b4391d27f40a0607985e6' 
  AND (
    token = '42NzrAbpwxfO/Ujg7jMMgH7tDFxGfxsU7d5cbSymYT8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041