UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mDp2R5dLo6Hk6QVuOCuYTqwRmXf3IbM6gpgVFMNfmuM=' 
WHERE 
  key_id = '05a84b2708f869948e68692ff55066c4fde321487fbb3898f0c3082ceebf92ac' 
  AND (
    token = 'mDp2R5dLo6Hk6QVuOCuYTqwRmXf3IbM6gpgVFMNfmuM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031