UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lU28+iI1ObaibvAa+YnCsQcJX+eQkR2EEmNrJ7n4hnA=' 
WHERE 
  key_id = '0e654e2298892e72b547e8712c04ec731e56f8fa7ec6afa97cc2c8ce6063d648' 
  AND (
    token = 'lU28+iI1ObaibvAa+YnCsQcJX+eQkR2EEmNrJ7n4hnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026