UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8upzH+sjyxZsmCrY4hcwFlnM3ZekrudxoSxibkvJxzA=' 
WHERE 
  key_id = '70d049c7a65299455e10b0426aad4cdfc1caa25dc43c6e28f5fa5b137ecff338' 
  AND (
    token = '8upzH+sjyxZsmCrY4hcwFlnM3ZekrudxoSxibkvJxzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032