UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZEb37yZf/W6ExiOoXUaSAvrdCUyVrK3VGMjfxeLespM=' 
WHERE 
  key_id = '8a26eb6a17ea432b00f440eb4faf24e5ab42e0e6a4b8863ac053f6861a0ecbcc' 
  AND (
    token = 'ZEb37yZf/W6ExiOoXUaSAvrdCUyVrK3VGMjfxeLespM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030