UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FNuQm+uzKVhc00caZ50qgvuEi/d1+HBZKcQQkr9+wfk=' 
WHERE 
  key_id = '3276d88bde56eea6ec8d9c2efd65148e20bca3dad9b404e5dc37c09b630b020f' 
  AND (
    token = 'FNuQm+uzKVhc00caZ50qgvuEi/d1+HBZKcQQkr9+wfk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048