UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pTgsbL9jxKAYAbLD2JawJR0XnMJJ7dNRLpwbcSuaLQI=' 
WHERE 
  key_id = '2183548dfd67f5dacb422eb3cba3d872ba2f06a5e16d1568d3158bbe2eb9bdd3' 
  AND (
    token = 'pTgsbL9jxKAYAbLD2JawJR0XnMJJ7dNRLpwbcSuaLQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032