UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NJwpbNja/4YcStZWFRU8WZmbZxGCVa0UEYdXHp2mMY8=' 
WHERE 
  key_id = '48fb93fbc3dd3c04066417fc2118050b70303247a54ec3c575aead0bb2ac8921' 
  AND (
    token = 'NJwpbNja/4YcStZWFRU8WZmbZxGCVa0UEYdXHp2mMY8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017