UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MkCLDWnUgcDMRtD+obzJJ/3xWftu2cUmd0crwGZGij0=' 
WHERE 
  key_id = '1f10fcbda969198f205e5ffe21c953cd254319f420e506ecfb6bcbfa96e0ed44' 
  AND (
    token = 'MkCLDWnUgcDMRtD+obzJJ/3xWftu2cUmd0crwGZGij0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044