UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zX0EJKy15j/ulNWNoXmFU9gX9Ean0rq5BXw0c1/wJuw=' 
WHERE 
  key_id = '3d3d800d29e5524d3bae7f10a96706406a39398dd92390d23d4b97e0c4f704a9' 
  AND (
    token = 'zX0EJKy15j/ulNWNoXmFU9gX9Ean0rq5BXw0c1/wJuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033