UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BkSATiYl4rH4W01+KaelZQJ4KXZRky4rIjpL9JNHrXI=' 
WHERE 
  key_id = '59bb9de1c3d06b20eba91b62b23b979573f4ade0973a2752762fe8028aeed6ba' 
  AND (
    token = 'BkSATiYl4rH4W01+KaelZQJ4KXZRky4rIjpL9JNHrXI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015