UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cdkNuhov90Q0jdHYHy66MXHCoqkJKQHWqX8zjGSOxuM=' 
WHERE 
  key_id = '0f5740f73ce42b67d9a1a61241bef0f6454e00c47e81645d45c7adf9e1eafd73' 
  AND (
    token = 'cdkNuhov90Q0jdHYHy66MXHCoqkJKQHWqX8zjGSOxuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022