UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2HUSDRg3lIT6kn+R8D+i9oX7n0pxOxZv3QKidzW43Vc=' 
WHERE 
  key_id = '96060213cd939392d0804bdc9e2d3f3eb4fbefb85b2d18334b2459522b869eb1' 
  AND (
    token = '2HUSDRg3lIT6kn+R8D+i9oX7n0pxOxZv3QKidzW43Vc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048