UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2causGpjSLj1thJFX1HlktJDAu7OChu/5CDzoMYdvCg=' 
WHERE 
  key_id = 'a0f86aed215e552424493a46e56e0c37984d982a936dd7e672a201df5ed3c68b' 
  AND (
    token = '2causGpjSLj1thJFX1HlktJDAu7OChu/5CDzoMYdvCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038