UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JY6Gje2QGAgvh6NZ3/6mUYp7DxVsOYCK4uBggCwHbp8=' 
WHERE 
  key_id = '07d41e31817717dcfda8ef690dd7b91ffc67cd980a0c7985dea7d666a479d040' 
  AND (
    token = 'JY6Gje2QGAgvh6NZ3/6mUYp7DxVsOYCK4uBggCwHbp8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031