UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nSgN2TY2xn9/8fJqKx4pUiz0kq2eY8ur+llZ/qoXWK4=' 
WHERE 
  key_id = '95987a652d3d6dd148abe8990843f76ca2695fcf91b425e13cc5fe69fe62b4c6' 
  AND (
    token = 'nSgN2TY2xn9/8fJqKx4pUiz0kq2eY8ur+llZ/qoXWK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030