UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bkXdpzGPrbGKAZ11R9GbcZeBkwHvnTI2QP+t76JcuOU=' 
WHERE 
  key_id = '276b64dbe0f981bc089bc27acaa23dbef2cd2084ac9a9421aecaff4f4441efdd' 
  AND (
    token = 'bkXdpzGPrbGKAZ11R9GbcZeBkwHvnTI2QP+t76JcuOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048